import yaml


def read_yaml_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        try:
            yaml_data = yaml.safe_load(file)
            return yaml_data
        except yaml.YAMLError as e:
            print(f"读取YAML文件时出错: {e}")


if __name__ == "__main__":
    file_path = "data.yml"
    data = read_yaml_file(file_path)
    if data:
        print(type(data))
        print(data["login"])
        print(data['mysql_msg'])
        print(data['app_parameter'])
        print(data['app_parameter']['appPackage'])
